<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="jt" uri="http://www.jsoft.org/tags/jsoft"%>
<%@ taglib prefix="jh" uri="http://www.jsoft.org/tags/jsoft-html"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	if(path!=null&&path.equals("/")){
	   path="";
	} 
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
   String currenturl = request.getRequestURI()+(request.getQueryString()==null?"":("?"+request.getQueryString()));
 
%>
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
     
    
    <title>东方通用户注册</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="东方通,注册">
	<meta http-equiv="description" content="注册">
 
  <meta http-equiv="Content-Type" content="text/html; charset=utf8"><style type="text/css"> 
<!--
body,td,th {
	font-size: 12px;
	color: #666666; line-height:22px;
}
a {
	font-size: 12px;
}
p{ padding-top:2px; padding-bottom:2px; margin-top:2px; margin-bottom:2px;}
.line{ border-bottom:1px solid #CCCCCC;}
.input{ width:200px; border:1px solid #B4D6E7;}
.cmd{ border:1px solid #0099CC; background:#DAE8EF; color:#006699; padding-top:3px; padding-bottom:2px; padding-left:6px; padding-right:6px;}
.rline{ border-right:1px solid  #CCCCCC;}
-->
</style>
<script src="<%=basePath%>js/jquery-1.5.1.min.js" type="text/javascript"></script>
 <script language="javascript" type="text/javascript">
function CheckForm(){  
	var iu, iuu, regArray=new Array("","???","???","???","???","???","???","???"+
	"!","@","#","$","%","^","&","*","(",")","-","+","=","|","'","[","]","???","~","`"+
	"!","<",">","???","???","???","???","???","??","??"); 
	var iu, iuu, regArray=new Array("","???","???","???","???","???","???","???"+
	"!","@","#","$","%","^","&","*","(",")","-","+","=","|","'","[","]","???","~","`"+
	"!","<",">","???","???","???","???","???","??","??"); 
	iuu=regArray.length;
	if (document.forms[0].code.value.length<4) {
		alert("请填写验证码.");
		document.forms[0].code.focus();
		return false;
	} 
	alert(C);
	if (document.forms[0].code.value==document.forms[0].reg.value) {
		 
	}else{
		alert("验证码错误.");
		document.forms[0].code.focus();
		return false;
	}
	iuu=regArray.length;
	
	for(iu=1;iu<=iuu;iu++){
		if (document.forms[0].username.value.indexOf(regArray[iu])!=-1){
			alert("用户名不能够包含字符：" + regArray[iu]);
			document.forms[0].username.focus();
			return false;
		}
	}
	if (document.forms[0].username.value.length==0) {
		alert("用户名不能够为空.");
		document.forms[0].username.focus();
		return false;
	}
	if (document.forms[0].username.value.length<4) {
		alert("用户名长度不少于4个字符.");
		document.forms[0].username.focus();
		return false;
	}
	if (document.forms[0].username.value.length>12) {
		alert("用户名长度不大于12个字符.");
		document.forms[0].username.focus();
		return false;
	}
	if (document.forms[0].username.value.indexOf(" ")!=-1){
		alert("用户名不能够包含空格");
		document.forms[0].username.focus();
		return false;
	}
	
	if (document.forms[0].password1.value.length==0) {
		alert("密码长度不能够为零");
		document.forms[0].password1.focus();
		return false;
	}
	if (document.forms[0].password1.value.length<6) {
		alert("密码长度不应该小于6.");
		document.forms[0].password1.focus();
		return false;
	}
	if (document.forms[0].password2.value.length==0) {
		alert("确认密码长度不能够等于零");
		document.forms[0].password2.focus();
		return false;
	}
	if (document.forms[0].password1.value != document.forms[0].password2.value) {
		alert("两次密码不一致.");
		document.forms[0].password1.focus();
		return false;
	}
	for(iu=1;iu<=iuu;iu++){
		if (document.forms[0].true_name.value.indexOf(regArray[iu])!=-1){
			alert("真实姓名不能够包含字符：" + regArray[iu]);
			document.forms[0].true_name.focus();
			return false;
		}
	}
	if (document.forms[0].true_name.value.length==0) {
		alert("真实姓名不能够为空.");
		document.forms[0].true_name.focus();
		return false;
	}
	if (document.forms[0].true_name.value.indexOf(" ")!=-1){
		alert("真实姓名不能够包含空格");
		document.forms[0].true_name.focus();
		return false;
	}
	if (document.forms[0].com_name.value.length==0) {
		alert("公司名称不能够为空.");
		document.forms[0].com_name.focus();
		return false;
	}
		if (document.forms[0].com_name.value.indexOf(" ")!=-1){
		alert("公司名称不能够包含空格");
		document.forms[0].com_name.focus();
		return false;
	}
	if (document.forms[0].addr.value.length==0) {
		alert("联系方式不能够为空.");
		document.forms[0].addr.focus();
		return false;
	}
		if (document.forms[0].addr.value.indexOf(" ")!=-1){
		alert("联系方式不能够包含空格");
		document.forms[0].addr.focus();
		return false;
	}
	if (document.forms[0].email.value.length==0) {
		alert("E_mail长度不能够等于零.");
		document.forms[0].email.focus();
		return false;
	}
	if (document.forms[0].email.value.length>0 && !document.forms[0].email.value.match(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) ) {
		alert("请填写正确的E_mail地址");
		document.forms[0].email.focus();
		return false;
	}
	if (document.forms[0].question.value.length>20) {
		alert("密码提示问题长度不能够大于20.");
		document.forms[0].question.focus();
		return false;
	}
	if (document.forms[0].answer.value.length>20) {
		alert("密码问题答案长度不能够大于20.");
		document.forms[0].answer.focus();
		return false;
	}
	return true;
} 

function chkfrm(v){
 if(v=='t'){
   $("#frmq").submit();
 }else{
  window.location.reload();
 }
}
function changeVerifyCode(){
	//alert('change');
    t=new Date().getTime();  
    $("#verifyCodeImg").attr("src","<%=basePath%>webs/vc.do?t="+t);
  }
  
</script>
</head>
  
<body>

   <form name="form1" id="frmq" method="post" action="<%=basePath%>webs/register.do" onSubmit="return CheckForm();">
        <input name="reg" type="hidden" value="" />
     
  <div align="center">
  <table width="100" height="540" border="0" align="center" cellpadding="0" cellspacing="0" style=" background:url(<%=basePath%>images/regbj.gif) left repeat-y;">
    <tr>
      <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td><img src="<%=basePath%>images/regtop.gif" width="775" height="31" border="0" usemap="#Map3" ></td>
        </tr>
      </table>
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td><a href="<%=basePath%>index.jsp"> <img src="<%=basePath%>images/reglogo.gif" width="254" height="32" style=" margin-left:40px;" border=0></a></td>
          </tr>
          <tr>
            <td align="right"><img src="<%=basePath%>images/regtitle.gif" width="225" height="36" style=" margin-right:40px;"></td>
          </tr>
          <tr>
            <td height="10" align="right" bgcolor="#A00E15"></td>
          </tr>
          <tr>
 
            <td height="30" align="right"><br><br></td>
          </tr>
        </table> 
        
        <!--  -->
           <table width="100%" border="0" cellpadding="0" cellspacing="0" style=" background:url(<%=basePath%>images/regyybj.gif) left repeat-y;">
          <tr>
            <td height="47"><img src="<%=basePath%>images/regyy.gif" width="775" height="74"></td>
          </tr>
          <tr>
            <td height="356" valign="top">
             <table width="87%" align="center" cellpadding="4" cellspacing="1">
          <tbody>
            <tr height="28">
              <td width="34%" height="35" align="right" bgcolor="#FFFFFF" class="line rline"><strong>系统验证码</strong> :<br />
               请填写右边正确的验证码 </td>
              <td width="66%" height="35" bgcolor="#FFFFFF" class="line"><input name="code" style=" width:80px;" type="text" class="input" id="code" />
              <!-- img src="<%=basePath%>user/yzm.jsp">${sessionScope.numrand} -->
               <img id="verifyCodeImg" src="<%=basePath%>webs/vc.do" style="cursor:hand" align="top" onClick="changeVerifyCode()"/>
                * 必填项<span id="nameinfo"></span></td>
            </tr>
            <tr height="28">
              <td width="34%" height="35" align="right" bgcolor="#FFFFFF" class="line rline"><strong>用户名</strong> :<br />
                用户名长度范围：4-12   个字符!<br />
                用户名不能够含有空字符和非法字符! </td>
              <td width="66%" height="35" bgcolor="#FFFFFF" class="line"><input name="username" type="text" class="input" id="username" />
                * 必填项<span id="nameinfo"></span></td>
            </tr>
            <tr>
              <td width="34%" height="35" align="right" bgcolor="#FFFFFF" class="line rline"><strong>密码</strong> :<br />
                密码长度应该大于等于6小于20   !<br />
                请不要以空字符或非法字符作为密码!<br /></td>
              <td height="35" bgcolor="#FFFFFF" class="line"><input   name="password1"  type="password" class="input"  id="password1"/>
                * 必填项 </td>
            </tr>
            <tr>
              <td height="35" align="right" bgcolor="#FFFFFF" class="line rline"><strong>密码确认</strong> :<br />
                再次输入密码，以此确认!<br /></td>
              <td height="35" bgcolor="#FFFFFF" class="line"><input  name="password2" type="password" class="input"  id="password2"/>
                * 必填项 </td>
            </tr>
            <tr height="28">
              <td width="34%" height="35" align="right" bgcolor="#FFFFFF" class="line rline"><strong>真实姓名：</strong> <br />
                为了方便为您服务，请填写你的联系方式!<br />              </td>
              <td height="35" bgcolor="#FFFFFF" class="line"><input name="true_name"  type="text" class="input" id="true_name" />
                  <span id="nameinfo"></span> * 必填项</td>
            </tr>
            
            <tr>
              <td height="35" align="right" bgcolor="#FFFFFF" class="line rline"><strong>E_mail地址</strong> :<br />
                请输入你的E_mail地址，<br />
                以便找回密码及管理员联系之用!<br /></td>
              <td height="35" bgcolor="#FFFFFF" class="line"><input  name="email"  type="text" class="input" id="email" />
                * 必填项<span id="mailinfo"></span> </td>
            </tr>
            <tr>
              <td height="35" align="right" bgcolor="#FFFFFF" class="line rline"><strong>密码提示问题</strong> :<br />
                请填写，以便找回密码时用!<br /></td>
              <td height="35" bgcolor="#FFFFFF" class="line"><input name="question" type="text" class="input" /></td>
            </tr>
            <tr>
              <td height="35" align="right" bgcolor="#FFFFFF" class="line rline"><strong>密码问题答案</strong> :<br />
                请填写上面问题答案，务必一定要记住! </td>
              <td height="35" bgcolor="#FFFFFF" class="line"><input name="answer" type="text" class="input" />              </td>
            </tr>
          </tbody>
        </table>
            </td>
          </tr>
          <tr>
            <td><img src="<%=basePath%>images/regbots.gif" width="775" height="70" border="0" usemap="#Map2"></td>
          </tr>
        </table>
       <input type="reset" name="button" id="cmdce" value="重置" style=" display:none;"/>
       <input type="submit" name="button2" id="cmdpost" value="提交" style=" display:none;"/>
        </form>
       <!--  -->    
<table width="100%" border="0" cellpadding="0" cellspacing="0">
       <tr>
         <td width="371" height="28" align="left" bgcolor="#d5d5d5" class="homefot">&nbsp;&nbsp;<a href="http://www.tongtech.com/english/index.html" style="text-decoration:none; color:#999999">English</a> | <a style="text-decoration:none; color:#999999" href="<%=basePath%>webs/category.do?m1=1&m2=141" >联系我们</a></td>
         <td width="372" align="center" bgcolor="#d5d5d5" class="homefot" style=" font-size:11px;">Copyright ©1992-2011 tongtech.com. All Rights Reserved. </td>
       </tr>
     </table> 
      </td>
    </tr>
  </table>
  </div>
  <script type="text/javascript">
  var registerMsg = "${requestScope.registerMsg}";
  if (registerMsg != null && registerMsg != "") {
      alert(registerMsg);
  }
  </script>
 
<map name="Map2">
<area shape="rect" coords="259,42,327,68" style=" cursor:pointer;" href="javascript:;"  onclick="chkfrm('t')">
<area shape="rect" coords="429,41,502,68" style=" cursor:pointer;" href="javascript:;" onClick="chkfrm('f')">
</map>
<map name="Map">
<area shape="rect" coords="259,42,327,68" href="<%=basePath%>user/register.jsp?step=2">
<area shape="rect" coords="429,41,502,68" href="<%=basePath%>index.jsp">
</map>
<map name="Map3">
<area shape="rect" coords="727,2,762,25" style=" cursor:pointer;"  href="javascript:;"  onclick="window.close();">
</map></body>
</html>

